package com.project.server.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.server.model.Restaurant;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface RestaurantMapper extends BaseMapper<Restaurant> {

    @Select("SELECT COUNT(*) FROM t_table WHERE restaurant_id = #{restaurantId} AND status != -1")
    Integer getTableCount(Long restaurantId);

    @Select("SELECT COUNT(*) FROM t_table WHERE restaurant_id = #{restaurantId} AND status = 0")
    Integer getAvailableTableCount(Long restaurantId);

    @Select("SELECT COUNT(*) FROM t_staff WHERE restaurant_id = #{restaurantId} AND status = 1")
    Integer getStaffCount(Long restaurantId);
}
